Skip to content

[.NET10] removal of generator generated code in Additions/ #1118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 80 commits into
base: main
Choose a base branch
from

Conversation

moljac
Copy link
Contributor

@moljac moljac commented Apr 2, 2025

Replacement PR for

#1058

for automatic builds (no need for manual /azp run comments).

Related:

To build this migration PR use following command:

dotnet cake -t=build-android-libraries-net10-net8  

or even better:

git clean -xdf ; dotnet cake -t=build-android-libraries-net10-net8  

And standard build is still according to documentation:

dotnet cake -t=ci

@moljac moljac added the do-not-merge PR is still in progress and is not ready to be merged label Apr 2, 2025
@moljac moljac marked this pull request as draft April 2, 2025 21:34
@moljac
Copy link
Contributor Author

moljac commented May 11, 2025

/azp run

Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

moljac and others added 9 commits May 13, 2025 07:15
obj/Controls.DeviceTests/Debug/net10.0-android/android/src/mono/androidx/recyclerview/widget/RecyclerView_ItemAnimator_ItemAnimatorListenerImplementor.java(8,57): javac error JAVAC0000:  error: ItemAnimatorListener is not public in ItemAnimator; cannot be accessed from outside package
Warning : Dependency `platforms;android-36` should have been installed but could not be resolved. You can attempt to install it with...
javac.exe error JAVAC0000:  error: BaseOnOffsetChangedListener cannot be inherited with different arguments: <com.google.android.material.appbar.AppBarLayout> and <>
Xamarin.Android.Javac.targets(161,5): error XAJVC0000: C:\a\_work\1\s\artifacts\obj\Benchmarks.Droid\Release\net10.0-android\android-arm64\android\src\mono\androidx\appcompat\widget\ActivityChooserModel_OnChooseActivityListenerImplementor.java:8: error: package androidx.appcompat.widget.ActivityChooserModel does not exist
Xamarin.Android.Javac.targets(161,5): error XAJVC0000: 		androidx.appcompat.widget.ActivityChooserModel.OnChooseActivityListener
Xamarin.Android.Javac.targets(161,5): error XAJVC0000: 		                                              ^
@jonathanpeppers
Copy link
Member

I ran apicompat on this: dotnet tool install --global Microsoft.DotNet.ApiCompat.Tool

Then the powershell pipeline:

Get-Item *.nupkg | ForEach-Object { Write-Output "apicompat package $_" ; & apicompat package $_.Name 2>&1 | ForEach-Object { "$_" } } > apidiff.txt

apidiff.txt

Which results in ~452 errors like:

CP0001: Type 'AndroidX.Core.Provider.FontsContractCompat.Columns' exists on lib/net8.0-android34.0/Xamarin.AndroidX.Core.dll but not on lib/net10.0-android36.0/Xamarin.AndroidX.Core.dll
...
CP0002: Member 'AndroidX.Activity.BackEventCompat.Companion.Companion(Kotlin.Jvm.Internal.DefaultConstructorMarker?)' exists on lib/net8.0-android34.0/Xamarin.AndroidX.Activity.dll but not on lib/net10.0-android36.0/Xamarin.AndroidX.Activity.dll
...
CP0005: Cannot add abstract member 'Java.Util.ISequencedCollection? Android.Gms.Internal.MLKitLanguageIdBundled.Zbi.Reversed()' to lib/net10.0-android36.0/Xamarin.Google.MLKit.Language.Id.dll because it does not exist on lib/net8.0-android34.0/Xamarin.Google.MLKit.Language.Id.dll

jonathanpeppers added a commit that referenced this pull request May 20, 2025
Taking a set of unrelated changes we can bring to main.

This will make the diff in #1118 easier to review.
@moljac
Copy link
Contributor Author

moljac commented May 21, 2025

After analysis of log submitted

CP0002: Member 'Square.OkHttp3.CacheControl.CacheControl(bool?, bool?, int?, int?, bool?, bool?, bool?, int?, int?, bool?, bool?, bool?, string?, Kotlin.Jvm.Internal.DefaultConstructorMarker?)' exists on lib/net8.0-android34.0/Square.OkHttp3.dll but not on lib/net10.0-android36.0/Square.OkHttp3.dll
CP0002: Member 'Square.OkHttp3.CipherSuite.CipherSuite(string?, Kotlin.Jvm.Internal.DefaultConstructorMarker?)' exists on lib/net8.0-android34.0/Square.OkHttp3.dll but not on lib/net10.0-android36.0/Square.OkHttp3.dll

with generated MCW code:

code -n $(find ./generated* -type f -iname "Square.OkHttp3.CacheControl.cs")

code -n $(find ./generated* -type f -iname "Square.OkHttp3.CipherSuite.cs")

Following class was suspicious:

    Kotlin.Jvm.Internal.DefaultConstructorMarker

But it is generated in both cases (net8.0/net8.0 and net8.0+net10.0/net10.0)

    ./generated/org.jetbrains.kotlin.kotlin-stdlib/obj/Release/net10.0-android/generated/src/Kotlin.Jvm.Internal.DefaultConstructorMarker.cs
    ./generated/org.jetbrains.kotlin.kotlin-stdlib/obj/Release/net8.0-android/generated/src/Kotlin.Jvm.Internal.DefaultConstructorMarker.cs
    ./generated-net8.0/org.jetbrains.kotlin.kotlin-stdlib/obj/Release/net8.0-android/generated/src/Kotlin.Jvm.Internal.DefaultConstructorMarker.cs

jonathanpeppers added a commit that referenced this pull request May 21, 2025
Context: #1118

Taking a set of unrelated changes we can bring to main.

This will make the diff in #1118 easier to review.

Changes such as:

* `.gitignore`
* Unrelated cake script changes
* Timeout values
* Create `build/scripts/provision-android/provision-android.csproj`
…rator-workarounds

Conflicts:
	.gitignore
	build/scripts/provision-android/provision-android.csproj
jonathanpeppers added a commit that referenced this pull request May 21, 2025
Context: #1118

This is a step to narrow down the API breaks in #1118.

I want to find out if any of them occur between .NET 8 and .NET 9.
@jonathanpeppers jonathanpeppers moved this from Todo to In Progress in .NET for Android Backlog May 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge PR is still in progress and is not ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants